K = 6;
n = 4;
T = 15;

A = cell(K,1);
A{1} = [ ... 
  0.974613,  0.005416,  0.338909,  0.145373,
  0.053034,  0.968552,  0.248223,  0.029486,
  -0.163864,  -0.032364,  0.847248,  -0.002269,
  -0.083829,  0.014624,  0.266229,  1.157479,
];

A{2} = [ ... 
  0.987410,  0.023077,  -0.012568,  0.022919,
  0.094696,  0.957696,  0.018856,  -0.121419,
  -0.053685,  -0.039576,  1.025950,  0.044159,
  0.040182,  0.145130,  -0.086010,  1.011792,
];

A{3} = [ ... 
  0.939168,  0.055795,  0.007536,  -0.052255,
  -0.011330,  0.992497,  -0.015185,  0.035225,
  -0.254674,  0.181117,  0.982911,  -0.086943,
  0.190628,  -0.136959,  0.011503,  1.068570,
];

A{4} = [ ... 
  1.011854,  -0.006006,  0.014586,  0.003463,
  0.036293,  0.986740,  0.047754,  0.010116,
  0.035943,  -0.064832,  1.016076,  0.014929,
  -0.048424,  0.056865,  -0.040062,  0.982782,
];

A{5} = [ ... 
  1.051422,  0.065121,  0.065513,  -0.046097,
  0.012282,  1.014907,  0.022017,  -0.015483,
  -0.060526,  -0.078696,  0.943018,  0.040122,
  0.039731,  0.053584,  0.018456,  0.986970,
];

A{6} = [ ... 
  1.062129,  -0.047598,  0.015538,  -0.037892,
  0.201861,  0.959273,  -0.002347,  -0.004480,
  0.112989,  0.028807,  0.996122,  -0.112590,
  0.092842,  -0.044787,  0.033195,  0.970655,
];

Q = [ ... 
  1.801362,  0.434618,  1.854163,  2.119112,
  0.434618,  1.239241,  -1.032350,  1.617343,
  1.854163,  -1.032350,  8.245716,  0.368032,
  2.119112,  1.617343,  0.368032,  3.923263,
];

x0 = [ ...
  -1.237416,
  -28.995344,
  -6.584492,
  -26.920183,
];

f = @(x) quad_form(x, Q)/2;

pstar = 11769.756573;
